<template>
	<scroll-view :scroll-x="lxName==='hd'" class="pz_box cardCont" :class="lxName">
		<view v-for="(item, index) in list" :key="index" class="pz_box_item mb3"
			@click="jump2('/pages/activity/detail?id=',item.id)">
			<image class="pzImg" :src="item.poster"></image>
			<view v-if="showList.indexOf('4') > -1" class="hd_item_tag"
				:class="item.status==0||item.status==2||item.status==4||item.status==5?'hui':item.status==1?'on':item.status==3?'blue':''">
				{{item.status == 0?'待发布':item.status == 1?'报名中':item.status == 2?'报名已截止':item.status == 3?'进行中':item.status == 4?'活动结束':'已取消'}}
			</view>
			<view class="pz_box_item_box">
				<view class="name">{{item.name}}</view>
				<view v-if="showList.indexOf('1') > -1 && lxName!=='zt'" class="bmNum">{{item.joinNum}}人已报名</view>
				<view v-if="showList.indexOf('2') > -1" class="time">活动时间：{{item.startDate}}{{item.endDate?'~' + item.endDate:''}}</view>
				<view v-if="showList.indexOf('3') > -1" class="price" :class="item.price>0?'redColor':'green'">
					{{item.price>0?'¥':'免费'}}<text v-if="item.price>0">{{item.price}}</text>
				</view>
			</view>
		</view>
	</scroll-view>
</template>

<script>
	export default {
		props: {
			lxName: {
				type: String,
				default: 'dt'
			},
			list: {
				type: Array,
				default: []
			},
			showList: {
				type: Array,
				default: ['1','2','3','4']
			},
		},
		methods: {
			jump(url, params, a) {
				this.$app.jump(url, params, a);
			},
			jump2(url, params, a) {
				this.$app.jump2(url, params, a);
			}
		}

	}
</script>
<style lang="scss" scoped>
	.pz_box {
		.pzImg {
			vertical-align: top;
		}
		.pz_box_item {
			width: 100%;
			border-radius: 8rpx;
			background-color: #FFFFFF;
			position: relative;
			overflow: hidden;

			.hd_item_tag {
				position: absolute;
				top: 20rpx;
				left: 20rpx;
				padding: 5rpx;
				width: 96rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				// background: $phb;
				background: $color;
				border-radius: 8rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #FFFFFF;

				// &.hui {
				// 	background: #999999;
				// }

				// &.on {
				// 	background: $phb;
				// }

				&.blue {
					// background: $blueBg;
					background: rgba(0, 0, 0, 0.6);
				}
			}

			.name {
				font-size: 30rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #222222;
				line-height: 1;
				margin-bottom: 15rpx;
			}
			.time {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
				margin-bottom: 5rpx;
			}

		}

		.price {
			font-size: 24rpx;
			line-height: 1;

			text {
				font-size: 32rpx;
				font-weight: bolder;
			}
		}


		&.dt{
			.pz_box_item {
				// border: 1rpx solid #E5E5E5;

				.pzImg {
					width: 100%;
					height: 388rpx;
				}

				.pz_box_item_box {
					position: static;
					box-sizing: border-box;
					padding: 20rpx;


					.bmNum {
						position: absolute;
						top: 325rpx;
						left: 20rpx;
						line-height: 42rpx;
						background: rgba(0, 0, 0, 0.6);
						border-radius: 22rpx;
						color: #fff;
						padding: 0 10rpx;
					}

				}
			}
		}
		&.hd {
			white-space: nowrap;
			display: flex;

			.pz_box_item {
				// border: 1rpx solid #E5E5E5;
				width: 440rpx;
				display: inline-block;
				margin-right: 30rpx;
				&:last-of-type {
					margin-right: 0;
				}

				.pzImg {
					width: 100%;
					height: 247rpx;
				}

				.pz_box_item_box {
					position: static;
					box-sizing: border-box;
					background-color: #fff;
					padding: 20rpx;

					.name {
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						line-height: 40rpx;
						-webkit-line-clamp: 1;
						/* autoprefixer: off */
						-webkit-box-orient: vertical;
						/* autoprefixer: on */
					}

					.bmNum {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
						margin-bottom: 10rpx;
					}
				}
			}
		}


		&.zt {
			.pz_box_item {
				display: flex;
				justify-content: space-between;
				background: none;

				.pzImg {
					width: 260rpx;
					border-radius: 8rpx;
					flex: none;
					height: 146rpx;
				}

				.pz_box_item_box {
					flex: 1;
					box-sizing: border-box;
					padding-left: 20rpx;
					position: static;

					.name {
						line-height: 1;
						margin-bottom: 20rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 1;
						/* autoprefixer: off */
						-webkit-box-orient: vertical;
						/* autoprefixer: on */
					}

					.bmNum {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
					}
					.time {
						margin-bottom: 20rpx;
					}
				}
			}
		}
	}
</style>